﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.Services;
using MSRI.TCPServices;
using MSRI.HelperClasses;
using System.Net;

namespace SMSWebService
{
    /// <summary>
    /// Summary description for SMSServiceProvider
    /// </summary>
    [WebService(Namespace = "http://tempuri.org/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    [System.ComponentModel.ToolboxItem(false)]
    // To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line. 
    // [System.Web.Script.Services.ScriptService]
    public class SMSServiceProvider : System.Web.Services.WebService
    {
        

        [WebMethod]
        public void SendSMS(String number, String Body)
        {
            TcpClientClass c = new TcpClientClass();
            c.InitTcpClientClass(IPAddress.Parse("127.0.0.1"), 3434);
            c.Connect();
            SmsClass Message = new SmsClass(number, Body);
            c.SendMessage(Message.ToString());
            c.Disconnect(true);
        }
    }
}
